import React from "react";
import {
  BrowserRouter as Router,
  Switch,
  Route,
  Redirect,
} from "react-router-dom";

import Home from "./pages/home/index";
import Target from "./pages/target/index";
import Demand from "./pages/demand/index";
import Discover from "./pages/discover/index";
import My from "./pages/my/index";
import Demo from "./pages/demo/index";
import Login from "./pages/login";
import "./App.css";


function App() {
  return (
    <Router>
      {/* 配置路由 */}
      <Switch>
        <Redirect path="/" to="/home" exact/>
        <Route path="/home" component={Home} />
        <Route path="/target/:id" component={Target} />
        <Route path="/demand" component={Demand} />
        <Route path="/discover" component={Discover} />
        <Route path="/my" component={My} />
        <Route path="/login" component={Login} />
        <Route path="/demo" component={Demo} />
      </Switch>  
    </Router>
  );
}

export default App;
